﻿CREATE TABLE [dbo].[Accounts_User_Details] (
    [User_GUID]    UNIQUEIDENTIFIER NOT NULL,
    [first_name]   VARCHAR (50)     NULL,
    [last_name]    VARCHAR (50)     NULL,
    [organisation] VARCHAR (50)     NULL,
    [phone_number] VARCHAR (30)     NULL,
    CONSTRAINT [PK_Accounts_User_Details] PRIMARY KEY CLUSTERED ([User_GUID] ASC),
    CONSTRAINT [FK_Accounts_User_Details_Accounts_User] FOREIGN KEY ([User_GUID]) REFERENCES [dbo].[Accounts_User] ([User_GUID]),
    UNIQUE NONCLUSTERED ([User_GUID] ASC)
);


GO
CREATE NONCLUSTERED INDEX [Accounts_User_Details_All_Index]
    ON [dbo].[Accounts_User_Details]([first_name] ASC, [last_name] ASC, [organisation] ASC, [phone_number] ASC);

